//需要弹出的内容放在class为popContent的容器里
;(function($){
	$.fn.extend({
		"addbox":function($this){
		var $this= $(this);
		this.bind("click",function(){
		var browserWidth = document.body.scrollWidth;
		var winWidth = $(window).width();
		var winHeight = $(window).height();
		var scrollWidth =$(window).scrollLeft();
		var scrollHeight = document.body.scrollHeight;
		var bgHeight;
		if(winHeight<scrollHeight)
		{
			 bgHeight = scrollHeight;
			}
			else{
				bgHeight =winHeight;
				}
		var popContent = $(this).next('.popContent');
		var content = popContent.html();
		//创建html
		$('<div class="shadow_box"><p class="shadow_close"><img src="img/close.gif" alt="CLOSE"/></p><p style="clear:both;"></p><div class="shadow_cont">'+content+'</div></div>').appendTo('body');
		/*
		*@居中显示所需数据初始化
		*/
		var tipWidth = 795;//填出层宽度
		
		var tipHeight =566;//用于弹出层定位
		var MarginLeft = (winWidth-tipWidth)/2;
		var Margintop = (winHeight-tipHeight)/2;
		/*
		*@添加背景遮罩层
		*/
		$("<div class='shadow_bg'></div>").appendTo('body');
		$('.shadow_bg').css({
			"width":browserWidth+scrollWidth,
			"height":bgHeight,
			"background-color":"#000",
			"position":"absolute",
			"left":0,
			"top":0,
			"z-index":"9999",
			"filter":"alpha(opacity=50)",
			"opacity": "0.5"
			});
		/*
		*@数据容器层
		*/
		$('.shadow_box').css({
			"width":tipWidth,
			"background-color":"#fff",	
			"border":"solid 3px #b3b3b3",
			"position":"absolute",
			"left":MarginLeft,
			"top":Margintop,
			"padding-bottom":"20px",
			"z-index":"99999"
			});
		$('.shadow_close').css({
			"color":"#000",
			"cursor":"pointer",
			"width":66,
			"height":22,
			"display":"block",
			"position":"absolute",
			"right":"24px",
			"top":"15px"
			});
		/*
		*@关闭按钮
		*/
			$('.shadow_close').click(function(){
			$('.shadow_bg,.shadow_box').remove();				   
			});
			$('.shadow_bg').click(function(){
			$('.shadow_bg,.shadow_box').remove();				   
			});
		return false;
		});  
		}
});
return this;   
})(jQuery);
	